package singleton.myself;


import singleton.myself.register.ContainerSingleton;

public class ContainerSingletonTest {
    public static void main(String[] args) throws Exception{


        Thread thread1=new Thread(new Runnable() {
            @Override
            public void run() {
                Object a = null;
                try {
                    a = ContainerSingleton.getInstance("singleton.myself.APo");
                } catch (Exception e) {
                    e.printStackTrace();
                }
                System.out.println(a.hashCode());
            }
        });

        Thread thread2=new Thread(new Runnable() {
            @Override
            public void run() {
                Object b = null;
                try {
                    b = ContainerSingleton.getInstance("singleton.myself.BPo");
                } catch (Exception e) {
                    e.printStackTrace();
                }
                System.out.println(b.hashCode());
            }
        });
        thread1.start();
        thread2.start();
    }
}
